<template>
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="list">
      <el-table-column label="持卡人姓名" align="center" prop="name" />
      <el-table-column label="身份证号码" align="center" prop="idCard" />
      <el-table-column label="银行卡号" align="center" prop="accountNo"/>
      <el-table-column label="银行预留号码" align="center" prop="phone"/>
      <el-table-column label="银行名称" align="center" prop="bankName"/>
      <el-table-column label="开户行" align="center" prop="bankAddress"/>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
import { listUserBankCard, } from "@/api/user/userBankCard";
export default {
  name: "UserBankCard",
  dicts: [],
  components: { },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 表格数据
      list: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查列表 */
    getList() {
      this.loading = true;
      listUserBankCard(this.queryParams).then(response => {
        this.list = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
  }
};
</script>